﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;

public delegate void TipsDialogCallBack();

public class TipsDialogPage : EventManager
{
    private TipsDialogCallBack confirmCallBack = null;
    private TipsDialogCallBack cancleCallBack = null;
    public Text content;
    public Text confirm;
    public Text cancel;
    public Button confirmBtn;
    public Button cancelBtn;


    void Start()
    {
        AddListenerToButton(confirmBtn ,ConfirmBtnClick);
        AddListenerToButton(cancelBtn,CancelBtnClick);
    }

    public void SetContent(string str)
    {
        this.content.text = str;
    }

    public void SetConfirmBtnContent(string confirmBtnStr)
    {
      //  this.confirm.text = confirmBtnStr;
    }

    public void SetCancelBtnContent( string cancelBtnStr)
    {
      //  this.cancel.text = cancelBtnStr;
    }

    public void ConfirmBtnClick()
    {

        if (this.confirmCallBack != null)
        {
            this.confirmCallBack();
        }
        Destroy(this.gameObject);
    }

    public void CancelBtnClick()
    {
        if (this.cancleCallBack !=null)
        {
            this.cancleCallBack();
        }
        Destroy(this.gameObject);
    }

    public void SetConfirmCallBack(TipsDialogCallBack confirmCB)
    {
        this.confirmCallBack = confirmCB;
    }
    public void SetCancleCallBack(TipsDialogCallBack cancleCB)
    {
        this.cancleCallBack = cancleCB;
    }

    public override void InformationSetting()
    {
    }
}

